# alg.py

from typing import List

class Solution:
    def maxProfit(self, prices: List[int]) -> int:
        profit = 0
        for i in range(1, len(prices)):
            if prices[i] > prices[i-1]:
                profit += prices[i] - prices[i-1]
        return profit

#只要后一天的股票价格高于前一天，就在这两天之间进行买入和卖出，把所有正利润都累加起来。